/*
 * @Description:
 * @Version:
 * @Author: Troubadour
 * @Date: 2022-09-14 20:01:49
 * @LastEditors: Troubadour
 * @LastEditTime: 2022-09-15 21:38:20
 */

#ifndef  __MYOLED_H__
#define  __MYOLED_H__

#include <Arduino.h>
#include <Wire.h>
#include "oledfont.h"


#define OLED_CMD  0                 //写命令
#define OLED_DATA 1                 //写数据


class MyOled
{
private:
    uint8_t OledAddr;
    void OLED_WR_Byte(uint8_t dat,uint8_t mode);

public:
    MyOled();
    MyOled(uint8_t addr);
    ~MyOled();

    void ColorTurn(uint8_t i);
    void DisplayTurn(uint8_t i);
    void Set_Pos(uint8_t x, uint8_t y);
    void Display_On(void);
    void Display_Off(void);
    void Clear(void);
    void Full(uint8_t x, uint8_t y, uint8_t sizex, uint8_t sizey, uint8_t mode);
    void ShowChar(uint8_t x,uint8_t y,const uint8_t chr,uint8_t sizey);
    uint32_t Pow(uint8_t m,uint8_t n);
    void ShowNum(uint8_t x,uint8_t y,uint32_t num,uint8_t len,uint8_t sizey);
    void ShowString(uint8_t x,uint8_t y,const char *chr,uint8_t sizey);
    void ShowChinese(uint8_t x,uint8_t y,const uint8_t no,uint8_t sizey);
    void DrawBMP(uint8_t x,uint8_t y,uint8_t sizex, uint8_t sizey,const uint8_t BMP[]);
    void Init(void);
};







#endif  /* __MYOLED_H__ */
